package it.win4buy.datamodel;

public class FlashDataModel {

	private final int REG_OK = 0;
	private UserData[] usersData = null;
	private TableData[] tablesData = null;

	public FlashDataModel() {

	}

	/**
	 * 
	 * @param userid
	 * @return
	 */
	public UserData getUserData(String userid) {

		if (usersData == null) {
			System.out
					.println("it.win4buy.datamodel.getUserData(): usersData is null");
			return null;
		}

		for (int i = 0; i < usersData.length; i++) {
			if (usersData[i].getUserId().equals(userid))
				return usersData[i];

		}
		return null;

	}

	public TableData[] getTablesData() {

		if (tablesData == null) {
			System.out
					.println("it.win4buy.datamodel.getTablesData(): tablesData is null");
			return null;
		}

		return tablesData;

	}

	/**
	 * 
	 * 
	 */
	public void setUsersData(UserData[] _usersData) {
		usersData = _usersData;

	}

	public void setTablesData(TableData[] _tablesData) {
		tablesData = _tablesData;

	}

}
